from selenium.webdriver.common.by import By
from base import Base

class Page(Base):
    def find_sousuo(self):
        # 点击搜索框
        loc=(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/androidx.drawerlayout.widget.DrawerLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.LinearLayout/android.widget.RelativeLayout/android.widget.RelativeLayout[2]/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.view.ViewGroup/android.widget.TextSwitcher/android.widget.TextView')
        ele=self.driver.dingwei(loc)
        return ele
    # 输入内容
    def find_shuruneirong(self):
        loc=(By.XPATH,'//android.widget.EditText[@resource-id="com.xiachufang:id/search_edit_text"]')
        ele=self.driver.dingwei(loc)
        return ele
    def find_sousuoanniu(self):
        loc=(By.XPATH,'//android.widget.TextView[@text="搜索"]')
        ele=self.driver.dingwei(loc)
        return ele
    def find_zonghe(self):
        loc=(By.XPATH,'new UISelector().text("综合")')
        ele=self.driver.dingwei(loc)
        return ele
